﻿using System.Collections.Generic;
using Aocsoft.Infrastructure.DomainBase;

namespace Aocsoft.Infrastructure.RepositoryFramework
{
    public interface IHierarchyRepository<TEntity, TID> : IRepository<TEntity, TID>
        where TEntity : EntityBase
    {
        TEntity GetAggregateById(TID nodeId);

        TEntity GetRootAggregate();

        ICollection<TEntity> GetAllLeafNodes();

        ICollection<TEntity> GetAllDescendantsOfNode(TID nodeId);

        ICollection<TEntity> GetAllAncestorsOfNode(TID nodeId);
    }
}
